﻿using System;
using System.Windows.Automation;

namespace QuickUIT.Controls
{
    /// <summary>
    /// Represents an image type control. 
    /// </summary>
    public class UIImage : UIBaseControl
    {
        /// <summary>
        /// Specifies the ordinal number of the column that contains this image.
        /// </summary>
        public new int Column
        {
            get { return base.Column; }
        }

        /// <summary>
        /// Specifies the number of columns spanned by this image.
        /// </summary>
        public new int ColumnSpan
        {
            get { return base.ColumnSpan; }
        }

        /// <summary>
        /// Specifies the ordinal number of the row that contains this image.
        /// </summary>
        public new int Row
        {
            get { return base.Row; }
        }

        /// <summary>
        /// Specifies the number of rows spanned by this image.
        /// </summary>
        public new int RowSpan
        {
            get { return base.RowSpan; }
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UIImage"/> class. 
        /// </summary>
        public UIImage()
            : base(ControlType.Image)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UIImage"/> class.
        /// </summary>
        /// <param name="parent">The parent of this control.</param>
        public UIImage(UIBaseControl parent)
            : base(parent, ControlType.Image)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UIImage"/> class.
        /// </summary>
        /// <param name="locator">The locator used to find the specific control.</param>
        public UIImage(string locator)
            : base(null, ControlType.Image, locator)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UIImage"/> class.
        /// </summary>
        /// <param name="parent">The parent of this control.</param>
        /// <param name="locator">The locator used to find the specific control.</param>
        public UIImage(UIBaseControl parent, string locator)
            : base(parent, ControlType.Image, locator)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UIImage"/> class.
        /// </summary>
        /// <param name="control">The underlying <see cref="AutomationElement"/> of the control.</param>
        public UIImage(AutomationElement control) : base(control, ControlType.Image)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UIImage"/> class.
        /// </summary>
        /// <param name="parent">The parent of the control</param>
        /// <param name="control">The underlying <see cref="AutomationElement"/> of the control.</param>
        public UIImage(UIBaseControl parent, AutomationElement control) : base(parent, control, ControlType.Image)
        {
        }

        /// <summary>
        /// Gets a collection of column headers associated with a table item or cell. 
        /// </summary>
        /// <returns>A collection of elements representing the column headers.</returns>
        /// <exception cref="InvalidOperationException">The pattern is not supported by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element is not available anymore.</exception>
        public new AutomationElement[] GetColumnHeaderItems()
        {
            return base.GetColumnHeaderItems();
        }

        /// <summary>
        /// Gets a collection of row headers associated with a table item or cell. 
        /// </summary>
        /// <returns>A collection of elements representing the column headers.</returns>
        /// <exception cref="InvalidOperationException">The pattern is not supported by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element is not available anymore.</exception>
        public new AutomationElement[] GetRowHeaderItems()
        {
            return base.GetRowHeaderItems(); 
        }
    }
}
